package com.star.controller.web;

import com.star.dto.ResponseData;
import com.star.util.InspectionTokenUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Classname OrderSkip
 * @Author Star
 * @Date 2021/4/28 - 8:47
 * @Description
 */
@Controller
@RequestMapping("/orderSkip")
public class OrderSkip {
    /**
     * 订单信息
     *
     * @return
     */
    @RequestMapping("/orderInfo")
    private String orderInfo(String token) {
        //查看返回值是否匹配
        ResponseData inspection = InspectionTokenUtils.inspectionForm(token);
        //判断是否是否有token 证明已经登录了
        if (inspection.getCode() == ResponseData.ok().getCode()) {
            //有token 查看订单信息
            return "holdUp/order/orderinfo";
        } else {
            //没有登录 跳转登录页面
            return "public/my/mylogin";
        }
    }

    /**
     * 店铺注册
     *
     * @return
     */
    @RequestMapping("/orderRegister")
    private String orderRegister() {
        return "holdUp/order/orderRegister";
    }
}
